package com.cliang.tools.verifycode;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;

import static org.junit.jupiter.api.Assertions.*;

class VerifyCodeUtilsTest {
//    VerifyCodeUtils verifyCodeUtils;
//
//    @BeforeAll
//    public void before(){
//         verifyCodeUtils=new VerifyCodeUtils();
//    }


    @Test
    void generateVerifyCode() throws IOException{
        VerifyCodeUtils verifyCodeUtils=new VerifyCodeUtils();
        File dir=new File("/tmp/verifies");
        int width=200,height=80;
        for(int i=0;i<50;i++){
            String verifyCode=verifyCodeUtils.generateVerifyCode(4);
            File file=new File(dir,verifyCode+".jpg");
            verifyCodeUtils.outputImage(width,height,file,verifyCode);
        }
    }

}